package com.jeomo.mem.starter.mapper;

import com.jeomo.base.starter.mapper.IBaseMapper;
import com.jeomo.mem.starter.entity.MemberLevelDailyExe;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

/**
 * 会员等级执行单明细 Mapper
 *
 * @author:Jackpot
 * @create 2021-01-14 11:25
 * @description:
 */
@Mapper
public interface MemberLevelDailyExeMapper extends IBaseMapper<MemberLevelDailyExe> {

    /**
     * 查询当天的会员卡消费/积分信息(同一会员级别)
     * @param pid
     * @param date
     * @return
     */
    @Select("select * from member_level_daily_exe as d where d.pid= #{pid} and d.that_day=#{date} ")
    MemberLevelDailyExe queryLevelDailyExe(@Param("pid") Long pid, @Param("date") LocalDate date);

    /**
     * 查询当天的会员卡消费/积分信息(同一会员级别)
     * @param cardNo
     * @param levelCode
     * @param date
     * @return
     */
    @Select("select * from member_level_daily_exe as d where d.card_no= #{cardNo} and d.level_code=#{levelCode} and d.that_day=#{date} ")
    MemberLevelDailyExe queryLevelDailyExec(@Param("cardNo") String cardNo,@Param("levelCode") String levelCode,
                                           @Param("date") LocalDate date);
}
